import axios from "../util/axios";

export function getUserInfo() {
  return axios.get("/user/info", {
    headers: {
      token: localStorage.getItem("token") || "",
    },
  });
}

export function EditUserInfo(params) {
  return axios.put("/user/info", params, {
    headers: {
      token: localStorage.getItem("token") || "",
    },
  });
}

export function login(params) {
  return axios.post("/user/login", params, {
    headers: {
      token: localStorage.getItem("token") || "",
    },
  });
}

export function logout() {
  return axios.post("/user/logout", {
    headers: {
      token: localStorage.getItem("token") || "",
    },
  });
}

export function register(params) {
  return axios.post("/user/register", params, {
    headers: {
      token: localStorage.getItem("token") || "",
    },
  });
}
